package _7_集合._4_Queue;

import org.junit.jupiter.api.Test;

import java.util.Deque;
import java.util.LinkedList;

public class DequeTest {

    @Test
    public void offerFirstAndOfferLastDequeTest(){
        Deque<String> deque = new LinkedList<>();
        deque.offerLast("A");//A
        deque.offerLast("B");//B -> A
        deque.offerFirst("C");//B -> A -> C
        System.out.println(deque.pollFirst());//C
        System.out.println(deque.pollLast());//B
        System.out.println(deque.pollFirst());//A
        System.out.println(deque.pollLast());//null
    }













}
